Skip to content

Conversation

@the-mikedavis
Copy link
Collaborator

Within rabbit_stream_coordinator:delete_stream/2, the stream could be successfully deleted from the stream coordinator but the update to the metadata store (rabbit_amqqueue:internal_delete/2) could fail separately. If this happens then subsequent attempts to delete the stream also fail because the coordinator did not reply to delete_stream requests for unknown stream IDs.

This change has the stream coordinator reply ok when it receives a delete_stream command and the stream is undefined. This would let the delete_stream/2 continue and remove the lingering state from the metadata store.

Fixes #14852

Within `rabbit_stream_coordinator:delete_stream/2`, the stream could be
successfully deleted from the stream coordinator but the update to the
metadata store (`rabbit_amqqueue:internal_delete/2`) could fail
separately. If this happens then subsequent attempts to delete the
stream also fail because the coordinator did not reply to
`delete_stream` requests for unknown stream IDs.

This change has the stream coordinator reply `ok` when it receives a
`delete_stream` command and the stream is `undefined`. This would let
the `delete_stream/2` continue and remove the lingering state from the
metadata store.
@the-mikedavis the-mikedavis self-assigned this Nov 3, 2025
@the-mikedavis
Copy link
Collaborator Author

The change turned out to be smaller than I expected if we take advantage of the existing filter_command/3 helper.

Does this need a new machine version? The only difference between old and new version is adding the reply effect, and reply effects are dropped by followers and during recovery IIRC.

@michaelklishin michaelklishin added this to the 4.3.0 milestone Nov 3, 2025
Copy link
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a reasonable and low risk change to me.

I'll defer to @kjnilsson @acogoluegnes.

@kjnilsson kjnilsson merged commit 04b9c50 into main Nov 4, 2025
291 checks passed
@kjnilsson kjnilsson deleted the md/idempotent-stream-delete branch November 4, 2025 09:41
michaelklishin added a commit that referenced this pull request Nov 4, 2025
rabbit_stream_coordinator: Handle delete_stream idempotently (backport #14884)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stream behavior in case of a partial deletion (deletion that fails midway)

4 participants